import random
with open("ips.txt", "w+") as f:
    for i in range(1200):
        f.write("172.25.254."+str(random.randint(1, 255))+'\n')

ip_dict = dict()
with open("ips.txt") as f:
    for k in f.readlines():
        if k in ip_dict:
            ip_dict[k] += 1
        else:
            ip_dict[k] = 1
# for key, value in ip_dict.items():
#     print(f"ip:{key}共出现了{value}次")
sort_ip = sorted(ip_dict.items(), key=lambda items: items[1], reverse=True)
